<meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="yes" name="apple-touch-fullscreen">
<meta content="telephone=no,email=no" name="format-detection">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<link href="static/favicon.ico" rel="apple-touch-icon-precomposed">
<link rel="shortcut icon" href="static/favicon.ico" type="image/x-icon" />
<link href="/static/style/global.css" rel="stylesheet">
<script type="text/javascript">
!(function(win, uiWidth, maxWidth) {
  var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; 
  var recalc = function () {
    var docEle = document.documentElement || document.body;
        // 是否为retina高清屏，只有retina高清屏才具备高级物理像素
    var isIos = win.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
        // 被iframe引用时，禁止缩放
        dpr = (win.top === win.self && isIos) ? Math.min((win.devicePixelRatio || 1), 3) : 1, 
        scale,
        deviceWidth = docEle.getBoundingClientRect ? docEle.getBoundingClientRect().width : docEle.clientWidth;
    
    scale = 1 / dpr;
    docEle.dataset.dpr = dpr;
    // 这种尺寸模式适用于最大范围
    var width = (deviceWidth >= maxWidth ? maxWidth : deviceWidth) * dpr;
    var metaEle = document.querySelector('meta[name="viewport"]') || document.createElement('meta');
    // metaEle.name = 'viewport';
    if (scale !== 1) {
      metaEle.content = 'initial-scale=' + scale + ','+ 'user-scalable=no,' + 'maximum-scale=' + scale + ', minimum-scale=' + scale + ',viewport-fit=cover';
    }
    
    fontSize = width * 100 / uiWidth;
    docEle.style.fontSize = [fontSize, 'px'].join('');
  }

  win.addEventListener(resizeEvt, function() {
    clearTimeout(this.timer);
    this.timer = setTimeout(recalc, 333);
  }, false);
  win.addEventListener('pageShow', function(e) {
    if (e.persisted) {
      clearTimeout(this.timer);
      this.timer = setTimeout(recalc, 333);
    }
  }, false);
})(window, 750, 750);
</script>
